<script type="text/javascript" src="<?php echo base_url(); ?>js/swfupload/swfupload.js?v=<?php echo $this->version; ?>"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/swfupload/handlers.js?v=<?php echo $this->version; ?>"></script>
<script type="text/javascript">
    var swfu;
    window.onload = new SWFUpload({
        // Backend Settings
        upload_url: "<?php echo site_url('admins/ajaxUpload/uploadPicture'); ?>",
        post_params: {
            "PHPSESSID": "<?php echo  $this->session->userdata('session_id'); ?>",
            "user_agent":"<?=$this->session->userdata('user_agent');?>"
        },

        // File Upload Settings
        file_size_limit : "<?php echo $this->fileUploadSize; ?>",	// 2MB
        file_types : "<?php echo $this->fileTypes; ?>",
        file_types_description : "JPG Images",
        file_upload_limit : "0",

        // Event Handler Settings - these functions as defined in Handlers.js
        //  The handlers are not part of SWFUpload but are part of my website and control how
        //  my website reacts to the SWFUpload events.
        file_queue_error_handler : fileQueueError,
        file_dialog_complete_handler : fileDialogComplete,
        upload_progress_handler : uploadProgress,
        upload_error_handler : uploadError,
        upload_success_handler : uploadSuccess,
        upload_complete_handler : uploadComplete,
        upload_start_handler : uploadStart,


        // Button Settings
        button_image_url : "",
        button_placeholder_id : "spanButtonPlaceholder",
        button_width: 280,
        button_height: 28,
        button_text : '<span class="button">选择图片<span class="buttonSmall">(2 MB Max)</span></span>',
        button_text_style : '.button { background-color:#FF9900;} .buttonSmall { font-size: 10pt; }',
        button_text_top_padding: 0,
        button_text_left_padding: 18,
        button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
        button_cursor: SWFUpload.CURSOR.HAND,

        // Flash Settings
        flash_url : "<?php echo base_url(); ?>js/swfupload/swfupload.swf",

        custom_settings : {
            upload_target : "divFileProgressContainer"
        },

        // Debug Settings
        debug: false
    });
/*]]>*/
</script>